#ifndef _T_CONSOLE_HANDLER_H_
#define _T_CONSOLE_HANDLER_H_
#include "libutilsbase.h"
#include <Windows.h>
LIB_NS_BEGIN

class LIBAPI  TStdoutHandler 
{
public:	
	

	TStdoutHandler();
	~TStdoutHandler();
typedef void OnDataCallBack(char* buff);
	bool StartHandler(OnDataCallBack* p);
	void StopHandler();


	static	DWORD __stdcall RedirectThreadProc(void* param);

private:
	
	OnDataCallBack* m_pCallBack;
	int m_fds[2];
	int m_orign_stdout;
	HANDLE m_thread_handle;
};


LIB_NS_END

#endif